// 防抖
export function debounce(fn, delay) {
  let timer = null
  return function() {
    const arg = arguments
    clearTimeout(timer)
    timer = setTimeout(() => {
      fn.apply(this, arg)
    }, delay)
  }
}
